package com.ehcache.ehcache;

import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;

public enum CacheManage {

	User_Cache("用户信息缓存", CacheManager.getInstance().getCache("userCache"));
	private String name;

	private Ehcache ehcache;

	private CacheManage(String name, Ehcache cache) {
		this.name=name;
		this.ehcache=cache;
	}
	public void putCache(String key,Object value){
		ehcache.put(new Element(key,value));
	}


	public <T> Object getCache(String key){

		return ehcache.get(key).getObjectValue();
	}

}
